<?php
namespace app\mini\controller\v1\shop;

use app\common\library\MemberVo;
use app\common\logic\OrderCommentLogic;
use app\common\model\ShopMemberPermission;
use app\mini\controller\Common;
use app\common\model\Shop;
use think\Request;

class Comment extends Common
{
    public $OrderCommentLogic;

    public function __construct(Request $request = null)
    {
        parent::__construct($request);
        $this->OrderCommentLogic = new OrderCommentLogic();
    }

    /**
     * 评论列表首页
     */
    public function index()
    {
        $res = $this->exception(function () {
            $params = request()->param();
            $params['shop_id'] = MemberVo::instance()->getShopId();
            return $this->OrderCommentLogic->index($params);
        });
        return $this->response($res);
    }

    /**
     * 评论数量统计
     */
    public function commentCount()
    {
        $res = $this->exception(function () {
            $params = request()->param();
            $params['shop_id'] = MemberVo::instance()->getShopId();
            return $this->OrderCommentLogic->commentCount($params);
        });
        return $this->response($res);
    }
}
